package com.example.pc.updata;

import android.app.Application;

import com.mob.MobSDK;
import com.zhy.http.okhttp.OkHttpUtils;



import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;


import cn.jpush.android.api.JPushInterface;
import okhttp3.OkHttpClient;

/**
 * Created by pc on 2018/3/20.
 */

public class MyApplication extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        sInstance = this;
//        Bmob.initialize(this, "352f6a8257f256c8143a5ee963cee06f");
//
//        x.Ext.init(this);
//        x.Ext.setDebug(false); //输出debug日志，开启会影响性能
        MobSDK.init(this,BuildConfig.MobAppKey,BuildConfig.MobAppSecret);
        JPushInterface.setDebugMode(true); 	// 设置开启日志,发布时请关闭日志
        JPushInterface.init(this);
        List<Integer> list = new ArrayList<>();
        list.add(R.mipmap.ban1);
        list.add(R.mipmap.ban2);
        list.add(R.mipmap.ban3);
        AppInfo.banner_list = list;

    }
    private static Application sInstance;
    public static Application getInstance() {
        return sInstance;
    }
    public void getokhttp() {
        OkHttpClient okHttpClient = new OkHttpClient.Builder()
//                .addInterceptor(new LoggerInterceptor("TAG"))
                .connectTimeout(30000L, TimeUnit.MILLISECONDS)
                .readTimeout(30000L, TimeUnit.MILLISECONDS)
                //其他配置
                .build();

        OkHttpUtils.initClient(okHttpClient);
    }
}
